package com.sokal.easycare.modules.product.entity.product;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sokal.easycare.common.persistence.DataEntity;

/**
 * 产品Entity
 * @author liliangdong
 * @version 2017-03-12
 */
public class ProAttribute extends DataEntity<ProAttribute> {
	
	private static final long serialVersionUID = 1L;
	private String name;		// 属性名
	private String value;		// 属性值
	private ProProduct proProduct;		// 商品ID 父类
	
	public ProAttribute() {
		super();
	}

	public ProAttribute(String id){
		super(id);
	}

	public ProAttribute(ProProduct proProduct){
		this.proProduct = proProduct;
	}

	@Length(min=0, max=100, message="属性名长度必须介于 0 和 100 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=500, message="属性值长度必须介于 0 和 500 之间")
	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
	
	@JsonIgnore
	@Length(min=0, max=64, message="商品ID长度必须介于 0 和 64 之间")
	public ProProduct getProProduct() {
		return proProduct;
	}

	public void setProProduct(ProProduct proProduct) {
		this.proProduct = proProduct;
	}
	
}